import request from '@/utils/request'

export default {
  // 获取分类列表
  getList(params) {
    return request({
      url: '/api/categories',
      method: 'get',
      params
    })
  },

  // 获取分类详情
  getDetail(id) {
    return request({
      url: `/api/categories/${id}`,
      method: 'get'
    })
  },

  // 创建分类
  create(data) {
    return request({
      url: '/api/categories',
      method: 'post',
      data
    })
  },

  // 更新分类
  update(id, data) {
    return request({
      url: `/api/categories/${id}`,
      method: 'put',
      data
    })
  },

  // 删除分类
  delete(id) {
    return request({
      url: `/api/categories/${id}`,
      method: 'delete'
    })
  }
} 